﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace AfterlifeLib
{
    public class Entity
    {
        private World m_world;
        public World World
        {
            get { return m_world; }
            set { m_world = value; }
        }

        private Vector2 m_position;
        public Vector2 Position
        {
            get { return m_position; }
            set { m_position = value; }
        }

        private Vector2 m_velocity;
        public Vector2 Velocity
        {
            get { return m_velocity; }
            set { m_velocity = value; }
        }

        private Vector2 m_origin;
        public Vector2 Origin
        {
            get { return m_origin; }
            set { m_origin = value; }
        }

        public Vector2 Center
        {
            get { return m_position + m_origin; }
        }

        private Texture2D m_texture;
        public Texture2D Texture
        {
            get { return m_texture; }
            set { m_texture = value; }
        }

        private float m_speed;
        public float Speed
        {
            get { return m_speed; }
            set { m_speed = value; }
        }

        private float m_rotation;
        public float Rotation
        {
            get { return m_rotation; }
            set { m_rotation = value; }
        }

        public Entity(World world)
        {
            World = world;
        }

        public virtual void LoadContent(ContentManager content)
        {

        }

        public virtual void Update(GameTime gameTime)
        {
            
        }

        public virtual void Draw(SpriteBatch spriteBatch, Camera2D camera)
        {

        }

        protected T GetWorld<T>() where T : World
        {
            return (T)World;
        }
    }
}
